import * as systemService from '../../services/system';

export default {
  namespace: 'file',
  state:{
    pageRows:{},
  },
  reducers: {
    updatePageRows(state, {payload}) {
      const newstate = state;
      newstate.pageRows = payload;
      return newstate;
    },
  },
  effects: {
    *getPageFiles({payload}, {call, put}) {
      const {data} = yield call(systemService.getPageFiles,payload);
      yield put({type: 'updatePageRows', payload: data});
    },
    *delete({payload}, {call,put}) {
      yield call(systemService.deleteFiles,payload);
      yield put({type: 'getPageFiles', payload: payload.params});
    },
  },
  subscriptions: {

  },

}
